home *** CD-ROM | disk | FTP | other *** search
- /*
-
- Nullsoft WASABI Source File License
-
- Copyright 1999-2001 Nullsoft, Inc.
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
-
- Brennan Underwood
- brennan@nullsoft.com
-
- */
-
- // ===========================================================================
- //
- // NULLSOFT WASABI SDK EXAMPLE PROJECTS
- //
- // File: ExampleB.h
- //
- //!## Purpose: Define the ComponentClient class for our example component
- //
- // Requires: Please read Example1.h first.
- //
- // Notes: A note on the comments in this document:
- //
- // Notes that begin with *** are important notes that everyone
- // needs to read. The other comments assist readability or
- // explain the thinking behind sections of code which may not
- // be immediately obvious to the novice programmer.
- //
- // Or I'm just typing to hear myself clickyclack.
- //
-
-
- #ifndef _EXAMPLEB_H //EDITME
- #define _EXAMPLEB_H //EDITME
-
- //
- // There used to be a bunch of comments here.
- // But they didn't say anything terribly important.
- // And they were wildly offensive.
- //
- // So I deleted them. Sorry.
- //
- #include "../studio/wac.h"
- #include "../common/SimpleWndCreate.h"
-
-
- class ExampleBWnd;
-
- #define WACNAME WACExampleB //EDITME
- #define WACPARENT WAComponentClient
-
- class WACNAME : public WACPARENT {
- public:
- WACNAME();
- virtual ~WACNAME();
-
- virtual const char *getName();
- virtual GUID getGUID();
- virtual void onCreate();
- virtual void onDestroy();
- // WCS: START vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
- virtual void onRegisterServices();
- // WCS: END ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
- virtual RootWnd * createWindow(int n, RootWnd *parentWnd);
- const char *getWindowName();
- // WCS: START vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
- int destroyWindow(RootWnd * deadWnd);
- ThingerBitmapInfo getThingerBitmapInfo();
-
- //
- // ===========================================================================
- // ===========================================================================
- //
- // These items are needed for our component to be used as a Window Creation
- // object.
- public:
-
- #if 0 // Add this code to your constructor.
- WACNAME() {
- // Only allow a single instance to be constructed.
- ASSERT( myInstance == NULL );
- myInstance = this;
- }
- #endif
-
- static WACNAME & Main() {
- // Make that instance available as a static item.
- return * myInstance;
- }
- //
- // Therefore, if we wish, we can call down to that instance
- // to handle any of the necessary function calls required by
- // the template. Hooray for legacy code support.
- //
-
- //
- // The rest of the methods listed here are the required static
- // methods for any object that is passed into the above template.
- //
- // =========================================================================
- //
- static const char *getWindowNameStatic() {
- return Main().getName();
- }
- //
- static GUID getGUIDStatic() {
- return Main().getGUID();
- }
- //
- static RootWnd *createWindowStatic(int n, RootWnd *parentWnd) {
- return Main().createWindow(n, parentWnd);
- }
- //
- static int destroyWindowStatic(RootWnd *deadWnd) {
- return Main().destroyWindow(deadWnd);
- }
- //
- // If you are going to be using the Thinger template,
- // you also must provide the following method:
- //
- static ThingerBitmapInfo getThingerBitmapInfoStatic() {
- return Main().getThingerBitmapInfo();
- }
-
- private:
- static WACNAME * myInstance;
- // WCS: END ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
- // ===========================================================================
- private:
- ExampleBWnd *wnd;
- };
-
- #endif
-